package com.hyh.ui.keepalive;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.view.WindowManager;

import com.hyh.ui.base.BaseActivity;
import com.hyh.videochat.R;

public class KeepAliveActivity extends BaseActivity {
    @Override
    public int getLayout() {
        return R.layout.activity_keep_alive;
    }

    @Override
    public void getIntentExtras(Intent intent) {

    }

    @Override
    public void initDataAndEvent() {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
        getWindow().setLayout(0,0);
        registerReceiver(new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                KeepAliveActivity.this.finish();
            }
        },new IntentFilter(Intent.ACTION_SCREEN_ON));
    }




}
